package com.zm.zb100.controller;

import com.zm.zb100.persistence.entity.db.Demo;
import com.zm.zb100.repository.DemoRepository;
import com.zm.zb100.service.DemoService;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * DemoController
 *
 * <p>
 * </p>
 *
 * @author chuanbai
 * @date 2024/9/26
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

    @Resource
    private DemoRepository demoRepository;

    @Resource
    private DemoService demoService;

    @GetMapping("/t")
    public String test(){
        Demo demo = new Demo();
//        demo.setLogisticsNo("1Z24X7196650022101");
        demo.setLogisticsNo("9402109206094434190962");
        Demo save = demoRepository.save(demo);
        System.out.println(save);
        return "ok";
    }


    @GetMapping("/test")
    public String test11(){
        String string = demoService.outerInsert();
        return string;
    }


}
